package controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import pojo.Flight;
import service.FlightService;

import javax.annotation.Resource;
import java.util.List;


@Controller
@RequestMapping("flight")
public class FlightController {
    @Resource
    private FlightService flightService;
    @RequestMapping("list.html")
    public String getFlightList(Model model){
        //调用查询航班信息的方法
        List<Flight> flightList=flightService.getFlightList();
        model.addAttribute("flightList",flightList);
        return "flightlist";
    }
}
